package jtk.project4.fleet.screen.lastPmSetUp;


import java.awt.FlowLayout;


import jtk.project4.fleet.field.EquipmentLastPmSetUpServiceField;
import jtk.project4.fleet.field.EquipmentLastPmSetUpSumField;
import jtk.project4.fleet.field.EquipmentLastPmSetUpTextField;
import nl.coderight.jazz.action.Action;
import nl.coderight.jazz.form.FormField;
import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.FormView;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.control.TabControl;
import nl.coderight.jazz.form.control.TabItem;
import nl.coderight.jazz.form.field.button.PushButton;

public class LastPmSetUpView extends FormView{

	/*private TabControl LastPmSetUpTab;
	private TabItem LastPmTab;*/
	

	private PushButton printButton;
	private PushButton helpButton;
	private PushButton closeButton;
	private Action printAction;
	private Action helpAction;
	private Action closeAction;

	@Override
	protected void init() {
		// TODO Auto-generated method stub
		//createTabFields();		
		createFields();
		createLayout();
	}
	public LastPmSetUpView(){
		setSize(400, 500);
		center();
	}
	private void createLayout() {
		addField(createForm());
	}
	
	private void createFields() {
		printButton = new PushButton("printAction");
		helpButton = new PushButton("helpAction");
		closeButton = new PushButton("closeAction");
	}
	
	private GroupControl createForm(){
		GroupControl form = new GroupControl();
		form.addField(new EquipmentLastPmSetUpServiceField(""),NORTH);
		form.addField(new EquipmentLastPmSetUpSumField(""),WEST);
		//form.addField(new EquipmentLastPmSetUpTextField(""));
		/*form.addLabel("individual PM service. Since the program maintains this information");
		form.addLabel("automatically, this should only be necessary when initially setting up");
		form.addLabel("equipment or if a data entry error occurred.");*/
		form.addField(createButtons(), SOUTH);
		return form;
		
	}
	
	private GroupControl createButtons() {
		GroupControl buttons = new GroupControl();
		buttons.setLayout(new FlowLayout(FlowLayout.RIGHT));
		buttons.addField(printButton);
		buttons.addField(helpButton);
		buttons.addField(closeButton);
		return buttons;
	}
	


}
